<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <script type="text/javascript" src="<%=basePath%>js/jquery-1.9.0.min.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/xadmin.js"></script>
    <link rel="stylesheet" href="<%=basePath%>css/font.css">
	<link rel="stylesheet" href="<%=basePath%>css/xadmin.css">
    <script src="<%=basePath%>lib/layui/layui.js" charset="utf-8"></script>
    <script src="<%=basePath%>js/pc/admin/index.js" charset="utf-8"></script>
</head>
 <!-- 顶部开始 -->
    <div class="container">
        <div class="logo"><a><img style="width: 70%;" src="<%=basePath%>/images/1556088735.png"></a></div>
        <div class="left_open">
            <i title="展开左侧栏" class="iconfont">&#xe699;</i>
        </div>
        <ul class="layui-nav left fast-add" lay-filter="">
          <li class="layui-nav-item">
            <a href="javascript:;">+新增</a>
            <dl class="layui-nav-child"> <!-- 二级菜单 -->
               <dd><a onclick="x_admin_show('管理员','managementAdd.do')"><i class="iconfont">&#xe6b8;</i>管理员</a></dd>
            </dl>
          </li>
        </ul>
        <ul>
        <ul class="layui-nav right" lay-filter="">
          <li class="layui-nav-item">
            <a href="javascript:;">欢迎：<%=request.getSession().getAttribute("aUsername") %></a>
            <dl class="layui-nav-child"> <!-- 二级菜单 -->
              <dd><a href="javascript:loginOut()">退出</a></dd>
            </dl>
          </li>
          <!-- <li class="layui-nav-item to-index"><a href="index.do">前台首页</a></li> -->
        </ul>
         <li class="layui-nav-item to-index"><a id="demo" style="color: #f8eeee;"></a></li>
    	</ul>
    </div>
    <!-- 顶部结束 -->
    <!-- 中部开始 -->
     <!-- 左侧菜单开始 -->
    <div class="left-nav">
      <div id="side-nav">
        <ul id="nav" class="navMenu">
		</ul>
      </div>
    </div>
    <!-- <div class="x-slide_left"></div> -->
    <!-- 左侧菜单结束 -->
    <!-- 右侧主体开始 -->
    <div class="page-content">
        <div class="layui-tab tab" lay-filter="xbs_tab" lay-allowclose="false">
          <ul class="layui-tab-title">
            <li class="home"><i class="layui-icon">&#xe68e;</i>我的桌面</li>
          </ul>
          <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <iframe src='../../welcome.jsp' frameborder="0" scrolling="yes" class="x-iframe"></iframe>
            </div>
          </div>
        </div>
    </div>
    <div class="page-content-bg"></div>
    <!-- 右侧主体结束 -->
    <!-- 中部结束 -->
    <!-- 底部开始 -->
    <div class="footer">
        <div class="copyright">天祥瑞饲料</div>  
    </div>
    <!-- 底部结束 -->
<script type="text/javascript">
$('.left-nav #nav').delegate('li', 'click',function (event) {
    if($(this).children('.sub-menu').length){
        if($(this).hasClass('open')){
            $(this).removeClass('open');
            $(this).find('.nav_right').html('&#xe697;');
            $(this).children('.sub-menu').stop().slideUp();
            $(this).siblings().children('.sub-menu').slideUp();
        }else{
            $(this).addClass('open');
            $(this).children('a').find('.nav_right').html('&#xe6a6;');
            $(this).children('.sub-menu').stop().slideDown();
            $(this).siblings().children('.sub-menu').stop().slideUp();
            $(this).siblings().find('.nav_right').html('&#xe697;');
            $(this).siblings().removeClass('open');
        }
    }else{

        var url = $(this).children('a').attr('_href');
        var title = $(this).find('cite').html();
        var index  = $('.left-nav #nav li').index($(this));

        for (var i = 0; i <$('.x-iframe').length; i++) {
            if($('.x-iframe').eq(i).attr('tab-id')==index+1){
                tab.tabChange(index+1);
                event.stopPropagation();
                return;
            }
        };
        tab.tabAdd(title,url,index+1);
        tab.tabChange(index+1);
    }
    event.stopPropagation();
})
function loginOut(){
	$.post("loginOut.do",function(data){
		if(data.type==1){
			layer.msg(data.msg, {area:['300px', '200px']}); 
			window.location.href="../../login.jsp";
		}
	},"json")
}
</script>
</body>